var e = getApp();

Component({
    properties: {
        title: {
            type: null
        },
        desc: {
            type: null
        },
        img: {
            type: null
        },
        kid: {
            type: null
        },
        type: {
            type: null
        }
    },
    lifetimes: {
        attached: function() {
            console.log(this.data);
        },
        moved: function() {},
        detached: function() {}
    },
    observers: {
        kid: function(e) {
            console.log(e, "11112"), this.setData({
                id: e
            });
        }
    },
    data: {
        share_show: !1,
        link: "",
        posterShow: !1,
        img_url: "",
        id: ""
    },
    methods: {
        tapPosterShow: function() {
            this.setData({
                posterShow: !1
            });
        },
        openShare: function() {
            this.setData({
                share_show: !0
            });
        },
        closeShare: function(e) {
            this.setData({
                share_show: !1
            });
        },
        creatPoster: function() {
            var t = this;
            t.share_show = !1;
            var s = "", o = {
                id: t.properties.id
            };
            console.log(t.data.type), "case" == t.data.type ? s = e.getNetAddresss("plugin.case-library.api.release.get-case-poster") : "subject" == t.data.type && (s = e.getNetAddresss("plugin.case-library.api.release.get-special-poster")), 
            console.log(s), e._postNetWork({
                url: s,
                data: o,
                success: function(e) {
                    var s = e.data;
                    1 == s.result ? t.setData({
                        posterShow: !0,
                        img_url: s.data.url,
                        share_show: !1
                    }) : wx.showToast({
                        title: s.msg,
                        icon: "none",
                        duration: 1e3
                    });
                },
                fail: function(e) {
                    console.log(e);
                }
            });
        }
    }
});